// pages/artist/artist.js
import api from '../../utils/request.js'
Page({
  /**
   * 页面的初始数据
   */
  onShareAppMessage() {
    return {
    }
  },
  data: {
    currentData: 0,
    singerName: '',
    birthday: '',
    university: '',
    nationality: '',
    singerIntroduction: '',
    state: '',
    stageName: '',
    sex: '',
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      api.get("/singer/getSingerById", {
        id: "20",
      }).then(res => {
        // console.log(res.data);
        let datas = res.data
        this.setData({
          singerName: datas.singerName,
          birthday: datas.birthday,
          university: datas.university,
          nationality: datas.nationality,
          singerIntroduction: datas.singerIntroduction,
          state: datas.state,
          stageName: datas.stageName,
          sex: datas.sex,
          singerUrl: 'http://192.168.0.26:8081' + datas.singerUrl,
          music: datas.music,
        })
        // console.log(datas.music);
      }).catch(res => {
        console.log("请求错误");
      })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})